#pragma once

#include <gpiod.h>
#include <vector>
#include <string>
#include <chrono>
#include <thread>

#include <stdio.h>
#include <unistd.h>
#include <libserialport.h>

#include <iostream>

#include "rs485_v3.hpp"
#include "agile_modbus_rtu_master.hpp"
#include "yj_return.hpp"
#include "config.h"

typedef struct
{
    float temperature;
    float air_pressure_Height;
    float X_accel;
    float Y_accel;
    float Z_accel;
    float X_ang_vel;
    float Y_ang_vel;
    float Z_ang_vel;
    float X_angle;
    float Y_angle;
    float Z_angle;
}vit_hwt901_data_t,*Pvit_hwt901_data_t;


yj_return vit_hwt901_init(void);
void vit_hwt901_deinit(void);
yj_return vit_hwt901_read_all(vit_hwt901_data_t *data);
void vit_hwt901_print_data(vit_hwt901_data_t *data);
yj_return vit_hwt901_read_test(uint16_t *data);